<?php
include("../../app/View/Parts/left.ctp");
?>
	<div class="span9 well">
		<fieldset>
			<legend>Create Header</legend>
			<?php
				echo $this->Form->create('Gallery', array('type' => 'file'));
				echo $this->Form->input('image',array('type'=>'file'));
				echo "<br>";
				$options = array(
					'label' => 'Save',
					'class'=>'btn',
				);
				echo $this->Form->end($options);
			?>
			<div style="width:100%; height:10px;">&nbsp;</div>
		</fieldset>
	</div>
	<div style="width:100%; height:10px;"></div>
	<div class="span9">
	<table width="100%" class="table-bordered table-striped" cellpadding="5">
		<thead>
		<tr bgcolor="#ccc">
			<th>Sl</th>
			<th>Image</th>
			<th>Action</th>
		</tr>
		</thead>
		<tbody>
		<?php
			//print_r($galleries);
			$sl =0;
			foreach($galleries as $gallery){
				$sl ++;
				if($sl%2==0){
					echo "
						<tr bgcolor='#E2E2E2'>
							<td>".$sl."</td>
							<td><img src='".$base_url."/app/webroot/upload/banner/".$gallery['Gallery']['image']."' width='535' height='150'></td>
							<td>".$this->Form->postLink('Delete', array('action' => 'delete',$gallery['Gallery']['id']),array('confirm' => 'Are you sure?'))."</td>
						</tr>
					";
				}else{
					echo "
						<tr>
							<td>".$sl."</td>
							<td><img src='".$base_url."/app/webroot/upload/banner/".$gallery['Gallery']['image']."' width='535' height='150'></td>
							<td>".$this->Form->postLink('Delete', array('action' => 'delete',$gallery['Gallery']['id']),array('confirm' => 'Are you sure?'))."</td>
						</tr>
					";
				}
				
			}
		?>
		</tbody>
	</table>
	
	<div class="span12 margintop10">
			
		<div class="pagination">
			<?php
				echo $this->Paginator->prev( __('Previous'), array(), null, array('class' => 'prev disabled'));
				// Shows the page numbers
				echo $this->Paginator->numbers($options = array('separator'=>''));

				// Shows the next and previous links
				echo $this->Paginator->next(  __('Next'), array(), null, array('class' => 'next disabled'));
			?>
			<div class="counter">
			<?php
				// prints X of Y, where X is current page and Y is number of pages
				echo $this->Paginator->counter($options = array('tag'=>'span'));
			?>
			</div>
		</div>
				
	</div>
	</div>
<div style="clear:both;"></div>



